/**
 * 
 */
package org.istt.domain.acl;

import static javax.persistence.GenerationType.IDENTITY;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author Huy
 *
 */
@Entity
@Table(name="acl_object_identity")//, uniqueConstraints=@UniqueConstraint(columnNames={"object_id_class, object_id_identity"})
public class ObjectIdentity {
	private Long id;
	private Class objectIdClass;
	private Long objectIdIdentity;
	private ObjectIdentity parentObject;
	private Sid ownerSid;
	private Boolean entriesInheriting;
	
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	@ManyToOne
	@JoinColumn(name="object_id_class")
	public Class getObjectIdClass() {
		return objectIdClass;
	}
	public void setObjectIdClass(Class objectIdClass) {
		this.objectIdClass = objectIdClass;
	}
	
	@Column(name="object_id_identity")
	public Long getObjectIdIdentity() {
		return objectIdIdentity;
	}
	public void setObjectIdIdentity(Long objectIdIdentity) {
		this.objectIdIdentity = objectIdIdentity;
	}
	
	@ManyToOne @JoinColumn(name="parent_object")
	public ObjectIdentity getParentObject() {
		return parentObject;
	}
	public void setParentObject(ObjectIdentity parentObject) {
		this.parentObject = parentObject;
	}
	
	@ManyToOne @JoinColumn(name="owner_sid")
	public Sid getOwnerSid() {
		return ownerSid;
	}
	public void setOwnerSid(Sid ownerSid) {
		this.ownerSid = ownerSid;
	}
	
	@Column(name="entries_inheriting")
	public Boolean getEntriesInheriting() {
		return entriesInheriting;
	}
	public void setEntriesInheriting(Boolean entriesInheriting) {
		this.entriesInheriting = entriesInheriting;
	}
}
